package cn.mw.cmdb.entity;

import cn.mw.components.mongodb.anno.CMDBProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.Map;

@Data
@Document("mw_cmdbmd_datasource_sync_instance")
public class DataSourceSyncInstanceInfo implements Serializable {

    @Schema(description = "同步任务ID")
    @CMDBProperty(searchType = PropertyTypeString.ID, keywordSearch = true)
    private String taskId;

    @Schema(description = "实例ID")
    @CMDBProperty(searchType = PropertyTypeString.ID)
    private String instanceId;

    @Schema(description = "扫描结果")
    @CMDBProperty(searchType = PropertyTypeString.ID)
    private String scanResult;

    @Schema(description = "数据源Id")
    @CMDBProperty
    private String hostId;

    @Schema(description = "主机IP")
    @CMDBProperty(searchType = PropertyTypeString.ID, keywordSearch = true)
    private String hostIp;

    @Schema(description = "主机名")
    @CMDBProperty(searchType = PropertyTypeString.ID, keywordSearch = true)
    private String name;

    @Schema(description = "错误信息")
    @CMDBProperty
    private String errorMsg;

    @Schema(description = "实例属性")
    @CMDBProperty
    private Map<String, Object> instanceParams;

    @Schema(description = "同步结果")
    @CMDBProperty(searchType = PropertyTypeString.ID, keywordSearch = true)
    private boolean asyncResult;
}
